<?php
if ($article) {
    $this->pageTitle = $article->metaTitle;
    $this->breadcrumbs = array($article->metaTitle);
    $this->metaTags = array(
        'description' => $article->metaDescription,
        'keywords' => $article->metaKeywords,
    );
} else {
    $this->pageTitle=Lang::t('contact.page.breadcrumbs');
    $this->breadcrumbs[]=Lang::t('contact.page.breadcrumbs');
    $this->metaTags = array(
        'description' => '',
        'keywords' => '',
    );
}
?>
<div class="form">
<?php 
$formConfig['htmlOptions']['class']='form-horizontal';
$formConfig['htmlOptions']['role']='form';
?>


<h1><?php echo Lang::t('contact.page.title'); ?></h1>

<?php if($article) echo $article->content; ?>


<?php $form = $this->beginWidget('ActiveForm', $formConfig); ?>
<span class="help-block"><?php echo Lang::t('contact.form.note'); ?></span>

<?php echo $form->alert($message, array(
    'errorMessageHtmlOptions'=>array('class'=>'alert alert-danger'), 
    'flashHtmlOptions'=>array('class'=>'alert alert-'),
)); ?>

<div class="form-group">
    <?php echo $form->labelEx($message,'name_', array('class'=>'col-sm-2 control-label')); ?>
    <div class="col-sm-6">
        <?php echo $form->textField($message,'name_',array('class'=>'form-control')); ?>
    </div>
    <?php //echo $form->error($message,'name_'); ?>
</div>

<div class="form-group">
    <?php echo $form->labelEx($message,'email_',array('class'=>'col-sm-2 control-label')); ?>
    <div class="col-sm-6">
        <?php echo $form->textField($message,'email_',array('class'=>'form-control')); ?>
    </div>
    <?php //echo $form->error($message,'email_'); ?>
</div>

<div class="form-group">
    <?php echo $form->labelEx($message,'contactNumber_',array('class'=>'col-sm-2 control-label')); ?>
    <div class="col-sm-6">
        <?php echo $form->textField($message,'contactNumber_',array('class'=>'form-control')); ?>
    </div>
    <?php //echo $form->error($message,'contactNumber_'); ?>
</div>

<div class="form-group">
    <?php echo $form->labelEx($message,'subject_',array('class'=>'col-sm-2 control-label')); ?>
    <div class="col-sm-6">
        <?php echo $form->dropDownList($message,'subject_', $message->subjectOption,array('class'=>'form-control')); ?>
    </div>
    <?php //echo $form->error($message,'subject_'); ?>
</div>

<div class="form-group">
    <?php echo $form->labelEx($message,'message_',array('class'=>'col-sm-2 control-label')); ?>
    <div class="col-sm-6">
        <?php echo $form->textArea($message,'message_', array('rows'=>5, 'cols'=>30, 'class'=>'form-control')); ?>
    </div>
    <?php //echo $form->error($message,'message_'); ?>
</div>

<div class="form-group">
    <?php $form->captchaImage(); ?>
    <?php echo $form->labelEx($message,'captcha_'); ?>
    <?php echo $form->textField($message,'captcha_'); ?>
    <?php echo $form->error($message,'captcha_'); ?>
</div>

<div class="form-group">
    <button type="submit" class="btn btn-default" /><?php echo Lang::t('contact.btn.submit'); ?></button>
</div>
<?php $this->endWidget(); ?>
</div><!--form-->